package com.chaopei.consumer_feign.controller;

import com.chaopei.consumer_feign.service.FeignService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author Corday 天涯
 * @Date 2022/4/27 10:06
 */
@RestController
public class FeignController {
    @Resource
    private FeignService fs;
    //http://localhost:8083/go?info=this is mary
    //请用postman调试接口
    @RequestMapping("/go")//@RequestParam("info")
    public  String go(String info){
        //获取外部服务数据,同时传数据到外部服务器
        String temp=fs.getInfo(info);//this is mary
        return "feign拿到:"+temp;
    }
    @RequestMapping("/play")
    public  String play(){
        return "这里也是feign!";
    }
}
